package com.yangjiangtao.ioc;

// MoGong 和 LiuDeHua 实现了解耦，MoGong无需关注角色实现类的实例化工作
public class MoGong implements ActorArrangable{
    private GeLi geli;

    public MoGong() {
    }

    // 构造函数注入
    public MoGong(GeLi geli) {
        this.geli = geli;
    }

    // 属性注入
    public void setGeli(GeLi geli) {
        this.geli = geli;
    }

    void cityGateAsk() {
        geli.responseAsk("墨者革离");
    }

    public GeLi getGeli() {
        return geli;
    }

    // 接口注入
    @Override
    public void injectGeli(GeLi geli) {
        this.geli = geli;
    }
}